<?php
namespace App\Transformers;

use League\Fractal\TransformerAbstract;
use App\Model\User;

class UserTransformer extends TransformerAbstract{

    public function transform(User $item){
        return [
            'id' => $item->id,
            'profile' => $item->profile,
            'nick_name' => $item->nick_name,
            'open_id' => $item->open_id,
            'created_at' =>$item->created_at->toDateTimeString(),
            'updated_at' =>$item->updated_at->toDateTimeString()
        ];
    }
}